package org.rambadger.command.command;


import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.rambadger.command.model.SubmissionEntity;
import static org.rambadger.command.model.SubmissionEntity.ReviewOutcome;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class FinalizeReview {
    @TargetAggregateIdentifier
    private final String submitterId;
    private final int submissionId;

    private final String reviewerId;

    private final int submissionPointsAwarded;
    private final int reviewPointsAwarded;

    private final ReviewOutcome outcome;


    public FinalizeReview(String submitterId, int submissionId, String reviewerId, int submissionPointsAwarded, int reviewPointsAwarded, ReviewOutcome outcome) {
        this.submitterId = submitterId;
        this.submissionId = submissionId;
        this.reviewerId = reviewerId;
        this.submissionPointsAwarded = submissionPointsAwarded;
        this.reviewPointsAwarded = reviewPointsAwarded;
        this.outcome = outcome;
    }

    @UrlIdentifier @NotNull
    public String getSubmitterId() {
        return submitterId;
    }

    @Min(1)
    public int getSubmissionId() {
        return submissionId;
    }

    @UrlIdentifier @NotNull
    public String getReviewerId() {
        return reviewerId;
    }

    @Min(0)
    public int getSubmissionPointsAwarded() {
        return submissionPointsAwarded;
    }

    @Min(0)
    public int getReviewPointsAwarded() {
        return reviewPointsAwarded;
    }

    @NotNull
    public SubmissionEntity.ReviewOutcome getOutcome() {
        return outcome;
    }
}
